#include "Cell.h"

Cell::Cell(unsigned int newUnitSize): floor(0), ceiling(0), shape(0), empty(true), defaultFloorPixel(DEFAULT_FLOOR_PIXELRGB), defaultCeilingPixel(DEFAULT_CEILING_PIXELRGB), unitSize(newUnitSize)
{
}

Cell::~Cell()
{
}

Slice Cell::GetSlice(const Vector& endpoint, const Scalar& distance) const
{
	Texture t(10,10);
	unsigned int height;
	Vector p1;
	Vector p2;

	Slice s(t, height, p1, p2);

	return s;
}

bool Cell::IsEmpty() const
{
	return empty;
}

void Cell::SetShape(Shape* newShape)
{
	shape = newShape;

	empty = false;
}

const Shape* Cell::GetShape() const
{
	return shape;
}

void Cell::RemoveShape()
{
	shape = 0;

	empty = true;
}

const Pixel& Cell::GetFloorPixel(unsigned int x, unsigned int y) const
{
	if (0 == floor)
	{
		return defaultFloorPixel;
	}
	else
	{
		return floor->GetPixel(x, y);
	}
}

const Pixel& Cell::GetCeilingPixel(unsigned int x, unsigned int y) const
{
	if (0 == ceiling)
	{
		return defaultCeilingPixel;
	}
	else
	{
		return ceiling->GetPixel(x, y);
	}
}

